(function () {
  let items = Array.from(document.querySelectorAll('.page-header .nav a')).reverse()
  for (const item of items) {
    let path = item.getAttribute('data-path')
    if (location.pathname.startsWith(path)) {
      item.classList.add('current')
      return
    }
  }
})()